package com.ailargemodel.common.config;


import com.rabbitmq.client.Channel;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.core.MessageProperties;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
import org.springframework.amqp.support.converter.MessageConverter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MyRabbitConfig {

//
//    @Bean
//    public MessageConverter messageConverter() {
//        return new Jackson2JsonMessageConverter();
//    }

//    @RabbitListener(queues = "hello-java-queue")
//    public void reciveMessage(Message message, Channel channel) {
//        byte[] body = message.getBody();
//        MessageProperties messageProperties = message.getMessageProperties();
//        System.out.println("接收到消息。。。内容"+message+ "==>类型是 " + message.getClass());
//    }
}
